<template>
  <el-menu
    :default-active="activeIndex2"
    active-text-color="#A8ABB2"
    background-color="#a0cfff"
    class="el-menu-demo"
    mode="horizontal"
    text-color="#fff"
    @select="handleSelect"
  >
    <el-menu-item index="1">
      <router-link to="/adhome"> 首页 </router-link>
    </el-menu-item>

    <el-menu-item disabled index="2">帮助与支持</el-menu-item>
    <el-menu-item index="3">
      <router-link to="/"> 退出 </router-link>
    </el-menu-item>

    <div class="avatar">
      <div class="block">
        <el-dropdown>
          <el-avatar :size="55" />
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item
                ><router-link to="/"> 退出 </router-link></el-dropdown-item
              >
              <el-dropdown-item>个人中心</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
  </el-menu>

  <el-row>
    <el-col :span="3">
      <h4 class="mb-2">水电费预缴费管理系统</h4>
      <el-menu
        class="el-menu-vertical-demo"
        default-active="2"
        @close="handleClose"
        @open="handleOpen"
      >
        <el-menu-item index="1">
          <el-icon>
            <el-icon-user />
          </el-icon>
          <router-link to="/manager"> 用户管理 </router-link>
        </el-menu-item>

        <el-menu-item index="2">
          <el-icon>
              <el-icon-money />
            </el-icon>
          <router-link to="/record"> 预缴费记录管理 </router-link>
        </el-menu-item>

        <el-menu-item index="3">
          <el-icon>
            <el-icon-reading />
          </el-icon>
          <router-link to="/Hydropower"> 账单管理 </router-link>
        </el-menu-item>

        <el-menu-item index="4">
          <el-icon>
            <el-icon-tickets />
          </el-icon>
          <router-link to="/waterRate"> 水费管理 </router-link>
        </el-menu-item>

        <el-menu-item index="5">
          <el-icon>
            <el-icon-document />
          </el-icon>
          <router-link to="/electricRate"> 电费管理 </router-link>
        </el-menu-item>

        <el-menu-item index="6">
          <el-icon>
            <el-icon-pie-chart />
          </el-icon>
          <router-link to="/statistics"> 报表统计 </router-link>
        </el-menu-item>
      </el-menu>
    </el-col>

    <router-view></router-view>
  </el-row>
</template>

<script>
import { defineComponent } from "vue";
import { Document, Location, Setting } from "@element-plus/icons-vue";
import { RouterLink } from "vue-router";
export default defineComponent({
  components: { Location, Document, Setting, RouterLink },
  data() {
    return {
      Hydropower: "/Hydropower",
      quit: "/",
      waterPrice: "/waterPrice",
      electricPrice: "/electricPrice",
      manager: "/manager",
      record: "/record",
    };
  },
});
</script>

<style scoped>
.mb-2 {
  margin-top: 50px;
  margin-left: 10px;
}

.avatar {
  //border: #4d4343 solid 1px;
  width: 79%;
  display: flex;
  justify-content: flex-end;
}

.el-menu-vertical-demo a {
  text-decoration: none; /* 去掉下划线 */
  color: inherit; /* 继承父元素颜色 */
}

.el-menu-demo .el-menu-item > a {
  color: #fff; /* 设置链接颜色 */
  text-decoration: none; /* 去掉下划线 */
}

h4.mb-2 {
  margin: 0; /* 移除外边距 */
  padding: 20px; /* 添加内边距 */
  color: #000; /* 字体颜色 */
  text-align: center; /* 文本居中 */
}
</style>
